﻿// -----------------------------------------------------------------------------
// Generate By Furion Tools v3.0.6                            
// -----------------------------------------------------------------------------

using Furion.DatabaseAccessor;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using HOPU.OnlineSchool.Core;

namespace HOPU.OnlineSchool.Core
{
    public partial class AclPermission : IEntity<MasterDbContextLocator>, IEntityTypeBuilder<AclPermission, MasterDbContextLocator>
    {
    
        public string Id { get; set; }
        public string Pid { get; set; }
        public string Name { get; set; }
        public byte Type { get; set; }
        public string PermissionValue { get; set; }
        public string Path { get; set; }
        public string Component { get; set; }
        public string Icon { get; set; }
        public byte? Status { get; set; }
        public byte IsDeleted { get; set; }
        public DateTime? GmtCreate { get; set; }
        public DateTime? GmtModified { get; set; }
    
        public void Configure(EntityTypeBuilder<AclPermission> entityBuilder, DbContext dbContext, Type dbContextLocator)
        {
                entityBuilder.ToTable("acl_permission");

                entityBuilder.HasComment("权限");

                entityBuilder.HasIndex(e => e.Pid, "idx_pid");

                entityBuilder.Property(e => e.Id)
                    .HasMaxLength(19)
                    .HasColumnName("id")
                    .HasDefaultValueSql("''")
                    .IsFixedLength(true)
                    .HasComment("编号");

                entityBuilder.Property(e => e.Component)
                    .HasMaxLength(100)
                    .HasColumnName("component")
                    .HasComment("组件路径");

                entityBuilder.Property(e => e.GmtCreate)
                    .HasColumnName("gmt_create")
                    .HasComment("创建时间");

                entityBuilder.Property(e => e.GmtModified)
                    .HasColumnName("gmt_modified")
                    .HasComment("更新时间");

                entityBuilder.Property(e => e.Icon)
                    .HasMaxLength(50)
                    .HasColumnName("icon")
                    .HasComment("图标");

                entityBuilder.Property(e => e.IsDeleted)
                    .HasColumnName("is_deleted")
                    .HasComment("逻辑删除 1（true）已删除， 0（false）未删除");

                entityBuilder.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(20)
                    .HasColumnName("name")
                    .HasDefaultValueSql("''")
                    .HasComment("名称");

                entityBuilder.Property(e => e.Path)
                    .HasMaxLength(100)
                    .HasColumnName("path")
                    .HasComment("访问路径");

                entityBuilder.Property(e => e.PermissionValue)
                    .HasMaxLength(50)
                    .HasColumnName("permission_value")
                    .HasComment("权限值");

                entityBuilder.Property(e => e.Pid)
                    .IsRequired()
                    .HasMaxLength(19)
                    .HasColumnName("pid")
                    .HasDefaultValueSql("''")
                    .IsFixedLength(true)
                    .HasComment("所属上级");

                entityBuilder.Property(e => e.Status)
                    .HasColumnType("tinyint")
                    .HasColumnName("status")
                    .HasComment("状态(0:禁止,1:正常)");

                entityBuilder.Property(e => e.Type)
                    .HasColumnType("tinyint")
                    .HasColumnName("type")
                    .HasComment("类型(1:菜单,2:按钮)");
        }

    }
}
